package so.sao.shop.supplier.pojo;

public class SystemContext {

	/**
	 * 每页的宽度
	 */
	private static ThreadLocal<Integer> pageSize = new ThreadLocal<Integer>();
	/**
	 * 每页的起始位置
	 */
	private static ThreadLocal<Integer> pageNum = new ThreadLocal<Integer>();
	/**
	 * order是以什么方式进行排序，asc为升序，desc为降序
	 */
	private static ThreadLocal<String> order = new ThreadLocal<String>();
	/**
	 * sort就是以什么列为基准进行排序
	 */
	private static ThreadLocal<String[]> sorts = new ThreadLocal<String[]>();
	/**
	 * 登录用户
	 */
	private static ThreadLocal<Object> loginUser = new ThreadLocal<Object>();

	public static Integer getPageSize() {
		return pageSize.get();
	}
	public static void setPageSize(Integer pageSize) {
		SystemContext.pageSize.set(pageSize);
	}
	public static void removePageSize() {
		pageSize.remove();
	}

	public static Integer getPageNum() {
		return pageNum.get();
	}
	public static void setPageNum(Integer pageNum) {
		SystemContext.pageNum.set(pageNum);
	}
	public static void removePageNum() {
		pageNum.remove();
	}

	public static String getOrder() {
		return order.get();
	}
	public static void setOrder(String order) {
		SystemContext.order.set(order);
	}
	public static void removeOrder() {
		order.remove();
	}

	public static String[] getSorts() {
		return sorts.get();
	}
	public static void setSorts(String[] sorts) {
		SystemContext.sorts.set(sorts);
	}
	public static void removeSorts() {
		sorts.remove();
	}
	
	public static Object getLoginUser() {
		return loginUser.get();
	}
	public static void setLoginUser(Object loginUser) {
		SystemContext.loginUser.set(loginUser);
	}
	public static void removeLoginUser() {
		loginUser.remove();
	}

}
